<!DOCTYPE html>
<html>
<head>

	<meta http-equiv="Content-type" content="text/html; charset=utf-8">

	<title>Menu System Test</title>

	<style type="text/css">
		@import "../themes/claro/document.css";
		@import "css/dijitTests.css";

		body { padding: 0; }

		/* styling for left-hand-side navigation menu to become a column equal to length of page */
		#formattingTable {
			border: 0px;
			border-spacing: 0px;
		}
		#contentContainer { padding: 2em; }

		#navMenu {
			/* make the sidebar menu blend in with the whole sidebar */
			border: none;
		}
	</style>

	<!-- required: a default dijit theme: -->
	<link id="themeStyles" rel="stylesheet" href="../../dijit/themes/claro/claro.css"/>

	<!-- required: dojo.js -->
	<script type="text/javascript" src="../../dojo/dojo.js"
		data-dojo-config="parseOnLoad: true, isDebug: true"></script>

	<!-- not needed, for testing alternate themes -->
	<script type="text/javascript" src="_testCommon.js"></script>

	<script type="text/javascript">
		dojo.require("dijit.dijit"); // optimize: load dijit layer
		dojo.require("dijit.Menu");
		dojo.require("dijit.MenuItem");
		dojo.require("dijit.PopupMenuItem");
		dojo.require("dijit.MenuBar");
		dojo.require("dijit.MenuBarItem");
		dojo.require("dijit.PopupMenuBarItem");
		dojo.require("dijit.MenuSeparator");
		dojo.require("dijit.ColorPalette");
		dojo.require("dijit.form.TextBox");
		dojo.require("dojo.parser");	// scan page for widgets and instantiate them
	</script>

    <script type="text/javascript">
        function createMenu() {
            // create a menu programmatically
            function fClick() {console.log("clicked!")};

            pMenu = new dijit.Menu({targetNodeIds:["prog_menu"], id:"progMenu"});
            pMenu.addChild(new dijit.MenuItem({label:"Programmatic Context Menu", disabled:true}));
            pMenu.addChild(new dijit.MenuSeparator());
            pMenu.addChild(new dijit.MenuItem({label:"Simple menu item", onClick:fClick, accelKey:"Shift+S"}));
            pMenu.addChild(new dijit.MenuItem({label:"Another menu item", onClick:fClick, accelKey:"Ctrl+A"}));
            pMenu.addChild(new dijit.MenuItem({label:"With an icon", iconClass:"dijitEditorIcon dijitEditorIconCut", onClick:fClick}));
            var mItem = new dijit.MenuItem({label:"dojo.event clicking", accelKey: "Alt+D"});
            dojo.connect(mItem, "onClick", function(){console.log("click! handler created via dojo.connect()")});
            pMenu.addChild(mItem);

            mItem = new dijit.CheckedMenuItem({label:"checkable menu item"});
            pMenu.addChild(mItem);

            var pSubMenu = new dijit.Menu({parentMenu:pMenu, id:"progSubMenu"});
            pSubMenu.addChild(new dijit.MenuItem({label:"Submenu item", onClick:fClick}));
            pSubMenu.addChild(new dijit.MenuItem({label:"Submenu item", onClick:fClick}));
			
            var pSubSubMenu = new dijit.Menu({parentMenu:pSubMenu, id:"progSubSubMenu"});
            pSubSubMenu.addChild(new dijit.MenuItem({label:"SubSubmenu item", onClick:fClick}));
            pSubSubMenu.addChild(new dijit.MenuItem({label:"SubSubmenu item", onClick:fClick}));
            pSubMenu.addChild(new dijit.PopupMenuItem({label:"SubSubmenu", popup:pSubSubMenu, id:"progPopupMenuItem2"}));

            pMenu.addChild(new dijit.PopupMenuItem({label:"Submenu", popup:pSubMenu, id:"progPopupMenuItem"}));

            pMenu.startup();

	    updateButtons(true);
            dojo.byId("prog_menu").innerHTML="This div has a programmatic context menu on it that's different to the page menu.";

            dojo.byId("createButton").disabled = true;
            dojo.byId("destroyButton").disabled = false;
        }

        function destroyMenu(){
        	pMenu.destroyRecursive();
            updateButtons(false);
        }

	function updateButtons(created){
            dojo.byId("prog_menu").innerHTML=created?"This div has a programmatic context menu on it that's different to the page menu.":"No programmatic menu on this div, should get page level menu.";
            dojo.byId("createButton").disabled = created;
            dojo.byId("destroyButton").disabled = !created;
	}
	dojo.addOnLoad(function(){
		// need to explicitly update our buttons states, otherwise the
		// browser will remember the last states of them before reloading
		// (so a programmatic menu is created, reload, and "the create
		// programmatic menu" button is still in disabled state)
		updateButtons(false);
	});
    </script>
</head>
<body class="claro">

	<div id="windowContextMenu" data-dojo-type="dijit.Menu" data-dojo-props='contextMenuForWindow:true, style:"display: none;"'>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Hello world"); }'>Context Menu</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='disabled:true, onClick:function(){ alert("this should NOT appear"); }'>Disabled Item</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
			onClick:function(){ console.log("not actually cutting anything, just a test!") }, accelKey:"Ctrl+X"'>Cut</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
			onClick:function(){ console.log("not actually copying anything, just a test!") }, accelKey:"Ctrl+C"'>Copy</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
			onClick:function(){ console.log("not actually pasting anything, just a test!") }, accelKey:"Ctrl+V"'>Paste</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div id="enabledSubmenu" data-dojo-type="dijit.PopupMenuItem" >
			<span>Enabled Submenu</span>
			<div id="submenu2" data-dojo-type="dijit.Menu" >
				<div id="submenu2_item1" data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
				<div id="submenu2_item2" data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
				<div id="deeperSubmenu" data-dojo-type="dijit.PopupMenuItem" >
					<span>Deeper Submenu</span>
					<div id="submenu4" data-dojo-type="dijit.Menu" >
						<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
						<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
					</div>
				</div>
			</div>
		</div>
		<div data-dojo-type="dijit.PopupMenuItem" data-dojo-props='disabled:true'>
			<span>Disabled Submenu</span>
			<div id="submenu3" data-dojo-type="dijit.Menu" data-dojo-props='style:"display: none;"'>
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
			</div>
		</div>
		<div data-dojo-type="dijit.PopupMenuItem">
			<span>Different popup</span>
			<div data-dojo-type="dijit.ColorPalette"></div>
		</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div data-dojo-type="dijit.CheckedMenuItem" data-dojo-props='checked:true, onChange:function(val){ console.log("Now set to " + val); }'>Checked</div>
		<div data-dojo-type="dijit.CheckedMenuItem">Not Checked</div>
		<div data-dojo-type="dijit.CheckedMenuItem" data-dojo-props='checked:true, disabled:true'>Checked Disabled</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div data-dojo-type="dijit.PopupMenuItem">
			<span>Bigger Submenu</span>
			<div id="bigsubmenu" data-dojo-type="dijit.Menu" data-dojo-props='style:"display: none;"'>
				<div data-dojo-type="dijit.MenuItem">Item One</div>
				<div data-dojo-type="dijit.MenuItem">Item Two</div>
				<div data-dojo-type="dijit.MenuItem">Item Three</div>
				<div data-dojo-type="dijit.MenuItem">Item Four</div>
				<div data-dojo-type="dijit.MenuItem">Item Five</div>
				<div data-dojo-type="dijit.MenuItem">Item Six</div>
				<div data-dojo-type="dijit.MenuItem">Item Seven</div>
				<div data-dojo-type="dijit.MenuItem">Item Eight</div>
				<div data-dojo-type="dijit.MenuItem">Item Nine</div>
				<div data-dojo-type="dijit.MenuItem">Item Ten</div>
			</div>
		</div>
	</div>

	<div id="leftClickContextMenu" data-dojo-type="dijit.Menu" data-dojo-props='leftClickToOpen:true, targetNodeIds:["input2"], style:"display: none;"'>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='disabled:true'>Left Click Menu</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Hello world"); }'>Enabled Item</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='disabled:true'>Disabled Item</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
			onClick:function(){ console.log("not actually cutting anything, just a test!") }'>Cut</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
			onClick:function(){ console.log("not actually copying anything, just a test!") }'>Copy</div>
		<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
			onClick:function(){ console.log("not actually pasting anything, just a test!") }'>Paste</div>
		<div data-dojo-type="dijit.MenuSeparator"></div>
		<div data-dojo-type="dijit.PopupMenuItem">
			<span>Enabled Submenu</span>
			<div id="leftsubmenu2" data-dojo-type="dijit.Menu" >
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
				<div data-dojo-type="dijit.PopupMenuItem">
					<span>Deeper Submenu</span>
					<div id="leftsubmenu4" data-dojo-type="dijit.Menu" >
						<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
						<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
					</div>
				</div>
			</div>
		</div>
		<div data-dojo-type="dijit.PopupMenuItem" data-dojo-props='disabled:true'>
			<span>Disabled Submenu</span>
			<div id="leftsubmenu3" data-dojo-type="dijit.Menu" data-dojo-props='style:"display: none;"'>
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
				<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
			</div>
		</div>
		<div data-dojo-type="dijit.PopupMenuItem">
			<span>Different popup</span>
			<div data-dojo-type="dijit.ColorPalette"></div>
		</div>
	</div>

	<table id="formattingTable">
		<tr>
			<td style="width:0%;">
				<!-- This is here for tabIndex testing.
				     Use textarea since Chrome 1.0 likes it better for TABing and
				     because it has innerText property and because it doesn't mess
				     with the URL when clicked -->
				<textarea id="link" tabIndex="0" readOnly class="dijitReset" style="font-family:monospace;font-size:12px;width:84px;text-decoration:underline;overflow:hidden;background-color:transparent;" rows=1>random link</textarea>
			</td>
			<td id="menuBarContainer" style="width:100%;">
				<div id="menubar" data-dojo-type="dijit.MenuBar">
					<div id="file" data-dojo-type="dijit.PopupMenuBarItem" >
						<span>File</span>
						<div id="fileMenu" data-dojo-type="dijit.Menu" >
							<div id="new" data-dojo-type="dijit.MenuItem" >New</div>
							<div id="open" data-dojo-type="dijit.MenuItem" >Open</div>
							<div id="separator" data-dojo-type="dijit.MenuSeparator" ></div>
							<div id="save" data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIconSave"'>Save</div>
							<div id="saveas" data-dojo-type="dijit.MenuItem" >Save As...</div>
						</div>
					</div>
					<div id="edit" data-dojo-type="dijit.PopupMenuBarItem" >
						<span>Edit</span>
						<div id="editMenu" data-dojo-type="dijit.Menu" >
							<div id="cut" data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
								onClick:function(){ console.log("not actually cutting anything, just a test!"); }, accelKey:"Ctrl+X"'>Cut</div>
							<div id="copy" data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
								onClick:function(){ console.log("not actually copying anything, just a test!") }, accelKey:"Ctrl+C"'>Copy</div>
							<div id="paste" data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
								onClick:function(){ console.log("not actually pasting anything, just a test!") }, accelKey:"Ctrl+V"'>Paste</div>
						</div>
					</div>
					<div id="view" data-dojo-type="dijit.PopupMenuBarItem" >
						<span>View</span>
						<div id="viewMenu" data-dojo-type="dijit.Menu" >
							<div data-dojo-type="dijit.MenuItem">Normal</div>
							<div data-dojo-type="dijit.MenuItem">Outline</div>
							<div data-dojo-type="dijit.PopupMenuItem">
								<span>Zoom</span>
								<div id="zoomMenu" data-dojo-type="dijit.Menu" >
									<div data-dojo-type="dijit.MenuItem">50%</div>
									<div data-dojo-type="dijit.MenuItem">75%</div>
									<div data-dojo-type="dijit.MenuItem">100%</div>
									<div data-dojo-type="dijit.MenuItem">150%</div>
									<div data-dojo-type="dijit.MenuItem">200%</div>
								</div>
							</div>
						</div>
					</div>
					<div id="help" data-dojo-type="dijit.PopupMenuBarItem" >
						<span>Help</span>
						<div id="helpMenu" data-dojo-type="dijit.Menu" >
							<div data-dojo-type="dijit.MenuItem">Help Topics</div>
							<div data-dojo-type="dijit.MenuItem">About Dijit</div>
						</div>
					</div>
					<div data-dojo-type="dijit.PopupMenuBarItem" data-dojo-props='disabled:true'>
						<span>Disabled</span>
						<div data-dojo-type="dijit.Menu">
							<div data-dojo-type="dijit.MenuItem">You should not see this</div>
						</div>
					</div>
					<div data-dojo-type="dijit.PopupMenuBarItem">
						<span>Empty</span>
						<div data-dojo-type="dijit.Menu">
						</div>
					</div>
					<div data-dojo-type="dijit.MenuBarItem" data-dojo-props='onClick:function(){ console.log("no submenu, just a clickable MenuItem"); }'>
						Click me!
					</div>
				</div>
			</td>
		</tr>
		<tr>
			<td id="navMenuContainer" class="dijitMenu" style="vertical-align:top; width:0%;">

				<h3 style="margin-bottom: 2em;">Navigation menu:</h3>
				<div id="navMenu" data-dojo-type="dijit.Menu" >
					<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
						onClick:function(){ console.log("drama!"); }'>Drama</div>
					<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCut",
						onClick:function(){ console.log("comedy!") }'>Comedy</div>
					<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconCopy",
						onClick:function(){ console.log("romance!") }'>Romance</div>
					<div data-dojo-type="dijit.MenuItem" data-dojo-props='iconClass:"dijitEditorIcon dijitEditorIconPaste",
						onClick:function(){ console.log("documentary!") }'>Documentary</div>
					<div data-dojo-type="dijit.MenuSeparator"></div>
					<div id="navMenuPopupItem1" data-dojo-type="dijit.PopupMenuItem" >
						<span>Enabled Submenu</span>
						<div id="navMenuSub1" data-dojo-type="dijit.Menu" >
							<div id="navMenuSub1_item1" data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
							<div id="navMenuSub1_item2" data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
							<div id="navMenuSub1_popup" data-dojo-type="dijit.PopupMenuItem" >
								<span>Deeper Submenu</span>
								<div id="navMenuSub2" data-dojo-type="dijit.Menu" >
									<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 1!") }'>Sub-sub-menu Item One</div>
									<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Sub-submenu 2!") }'>Sub-sub-menu Item Two</div>
								</div>
							</div>
						</div>
					</div>
					<div id="navMenuDisabledItem" data-dojo-type="dijit.PopupMenuItem" data-dojo-props='disabled:true '>
						<span>Disabled Submenu</span>
						<div id="navMenuSub3" data-dojo-type="dijit.Menu" data-dojo-props='style:"display: none;"'>
							<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 1!") }'>Submenu Item One</div>
							<div data-dojo-type="dijit.MenuItem" data-dojo-props='onClick:function(){ console.log("Submenu 2!") }'>Submenu Item Two</div>
						</div>
					</div>
					<div data-dojo-type="dijit.PopupMenuItem">
						<span>Different popup</span>
						<div data-dojo-type="dijit.ColorPalette"></div>
					</div>
					<div data-dojo-type="dijit.MenuSeparator"></div>
					<div data-dojo-type="dijit.CheckedMenuItem" data-dojo-props='checked:true, onChange:function(val){ console.log("Now set to " + val); }'>Checked</div>
					<div id="checked2" data-dojo-type="dijit.CheckedMenuItem" >Not Checked</div>
					<div data-dojo-type="dijit.CheckedMenuItem" data-dojo-props='checked:true, disabled:true'>Checked Disabled</div>
				</div>
			</td>

			<td style="padding: 1em" id="contentContainer">

				<h1 class="testTitle">Dijit Menu System Test</h1>

				<p>This page contains:</p>
				<ul>
					<li>"Navigation bar" Menu widget on left, a.k.a vertical MenuBar
					<li>MenuBar on top
					<li>page level context menu (right-click anywhere on page)
					<li>form widget context menu (right-click on textbox widget)</li>
					<li>left click context menu (left click on input on far right)
					<li>Example of programatically created menu
					<li>Note: while some accelerator (shortcut) keys are displayed in the context menu, they are not actually hooked up to the corresponding actions (if any), they need to be setup explicitly by the user
				</ul>

				<h3>Form</h3>

				<form>
					<p style="float:right; text-align: right;">
						left click to open the menu for this input:<br/>
						Note: because of the window contextMenu, make sure you get<br/>
						the right menu by verifying the left<br/>
						click one starts with "Left Click Menu"<br/>
						at the very top.
						<input id=input2 value="top-right"/>
					</p>
					<input id=input1 value="top-left"/>
					<textarea id=textarea>hello there!</textarea><br>
					<select>
						<option>check if i</option>
						<option>bleed through</option>
						<option>on IE6</option>
					</select>
					<button id=button>push me</button><br>
					<input data-dojo-type="dijit.form.TextBox" id="formwidget" data-dojo-props='style:"width:25em;", value:"dijit.form._FormWidget focus test"'/>
				</form>

			    <div id="prog_menu" style="clear: both; border:1px solid blue; padding:10px; margin:20px 0;">
			        Click button below to create special menu on this div.
			    </div>
			    <button id="createButton" onclick="createMenu();">create programmatic menu</button>
			    <button id="destroyButton" onclick="destroyMenu();" disabled>destroy programmatic menu</button>

				<div style="height:500px"></div>
				<p>(this space intentionally left blank to aid testing with controls
				at the bottom of the browser window)</p>
				<div style="height:500px"></div>
				<input id=input3 value="bottom-left"/>
				<p style="text-align:right"><input id=input4 value="bottom-right"/></p>

				<p>See also: <a href="form/test_Button.html">form/test_Button</a>
				(PopupMenu is used with DropDownButton and ComboButton)</p>

				<h3>Mouse opening tests</h3>

				<ul>
					<li>Right click on the client area of the page (ctrl-click for Macintosh). Menu should open.</li>
					<li>Right click on each of the form controls above. Menu should open.</li>
					<li>Right click near the righthand window border. Menu should open to the left of the pointer.</li>
					<li>Right click near the bottom window border. Menu should open above the pointer.</li>
				</ul>


				<h3>Mouse hover tests</h3>

				<ul>
					<li>Hover over the first item with the pointer. Item should highlight and get focus.</li>
					<li>Hover over the second (disabled) item. Item should highlight and get focus.</li>
					<li>Seperator items should not highlight on hover - no items should highlight in this case.</li>
				</ul>


				<h3>Mouse click tests</h3>

				<ul>
					<li>Click on the first menu item. console.log should log the message "Hello world". The menu should dissapear.</li>
					<li>Click on the second menu item (disabled). Should not do anything - focus should remain on the disabled item.</li>
					<li>Click anywhere outside the menu. Menu should close. Focus will be set by the browser based on where the user clicks.</li>
				</ul>


				<h3>Mouse submenu tests</h3>

				<ul>
					<li>Hover over the "Enabled Submenu" item. Item should highlight and then pop open a submenu after a short (500ms) delay.</li>
					<li>Hover over any of the other menu items. Submenu should close immediately and deselect the submenu parent item. The newly hovered item should become selected.</li>
					<li>Hover over the "Disabled Submenu" item. Item should highlight, but no submenu should appear.</li>
					<li>Clicking on the "Enabled Submenu" item before the submenu has opened (you'll have to be quick!) should immediatley open the submenu.</li>
					<li>Clicking on the "Enabled Submenu" item <i>after</i> the submenu has opened should have no effect - the item is still selected and the submenu still open.</li>
					<li>Hover over submenu item 1. Should select it - the parent menu item should stay selected also.</li>
					<li>Hover over submenu item 2. Should select it - the parent menu item should stay selected also.</li>
				</ul>


				<h3>Keyboard opening tests</h3>

				<ul>
					<li>On Windows: press shift-f10 with focus on any of the form controls. Should open the menu.</li>
					<li>On Windows: press the context menu key (located on the right of the space bar on North American keyboards) with focus on any of the form controls. Should open the menu.</li>
					<li>On Firefox on the Mac: press ctrl-space with focus on any of the form controls. Should open the menu.</li>
				</ul>


				<h3>Keyboard closing tests</h3>

				<ul>
					<li>Open the menu.</li>
					<li>Press tab. Should close the menu and return focus to where it was before the menu was opened.</li>
					<li>Open the menu.</li>
					<li>Press escape. Should close the menu and return focus to where it was before the menu was opened.</li>
				</ul>


				<h3>Keyboard navigation tests</h3>

				<ul>
					<li>Open the menu.</li>
					<li>Pressing up or down arrow should cycle focus through the items in that menu.</li>
					<li>Pressing enter or space should invoke the menu item.</li>
					<li>Disabled items receive focus but no action is taken upon pressing enter or space.</li>
				</ul>


				<h3>Keyboard submenu tests</h3>

				<ul>
					<li>Open the menu.</li>
					<li>The first item should become selected.</li>
					<li>Press the right arrow key. Nothing should happen.</li>
					<li>Press the left arrow key. Nothing should happen.</li>
					<li>Press the down arrow until "Enabled Submenu" is selected. The submenu should not appear.</li>
					<li>Press enter. The submenu should appear with the first item selected.</li>
					<li>Press escape. The submenu should vanish - "Enabled Submenu" should remain selected.</li>
					<li>Press the right arrow key. The submenu should appear with the first item selected.</li>
					<li>Press the right arrow key. Nothing should happen.</li>
					<li>Press the left arrow key. The submenu should close - "Enabled Submenu" should remain selected.</li>
					<li>Press the left arrow key. The menu should <i>not</i> close and "Enabled Submenu" should remain selected.</li>
					<li>Press escape. The menu should close and focus should be returned to where it was before the menu was opened.</li>
				</ul>
			</td>
		</tr>
	</table>
</body>
</html>
